#include "../TcpClass.h"
int main()
{
	char filename[70];
	scanf("%s",filename);
	
	TcpSocket ts;
    TcpSockConnect(&ts,"127.0.0.1",9999);
	TcpSockSend(&ts,filename,sizeof(filename));
	int source_fd = open(filename,O_RDONLY);
	char buffer[1024];
	int size;
	unsigned long long sum = 0;
	while((size = read(source_fd,buffer,sizeof(buffer))) > 0)
	{
		sum+=size;
		printf("size: %d\n",size);
		TcpSockSend(&ts,buffer,size);
	}
	printf("sum: %llu\n",sum);
	close(source_fd);
	TcpSockClose(&ts);
	printf("transport success\n");
}
